#!ipxe

goto ${menu} ||

:live_menu
set os Regolith
menu ${os} - Current Arch [ ${arch} ]
iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
item --gap ${os} Versions
item current ${space} ${os} Current
choose live_version || goto live_exit
goto ${live_version}

:current
set squash_url ${live_endpoint}{{ endpoints["regolith-current"].path }}filesystem.squashfs
set kernel_url ${live_endpoint}{{ endpoints["regolith-current"].path }}
goto current-boot

:current-boot
imgfree
kernel ${kernel_url}vmlinuz ip=dhcp boot=casper netboot=http fetch=${squash_url} initrd=initrd ${cmdline}
initrd ${kernel_url}initrd
boot

:live_exit
clear menu
exit 0
